Option Explicit
Sub F_Sample007()
    'Microsoft DAO 3.6 Object Library ]wޥζ
    'ոF_Data.csv 
    Dim myWsp  As DAO.Workspace
    Dim myCon  As DAO.Connection
    Dim myRst  As DAO.Recordset
    Dim myCnc1 As String
    Dim myCnc2 As String
    Dim myCnc3 As String
    Dim myCnc4 As String
    Dim myCmd  As String
    Dim i      As Long
    myCnc1 = "ODBC;"
    myCnc2 = "DBQ=" & ThisWorkbook.Path & ";"
	myCnc3 = "Driver={Driver da Microsoft para arquivos texto" & _ 
			" (*.txt; *.csv)};"
    		myCnc4 = "FILEDSN=C:"
'HSQLԭzŪJɮ
    myCmd = "SELECT * FROM F_Data.csv E_Book1 ORDER BY E_Book1.s"
    Set myWsp = CreateWorkspace("myWsp", "myName", "", dbUseODBC)
    Workspaces.Append myWsp
    Set myCon = myWsp.OpenConnection( _
        Name:="myConnection", _
        Options:=dbDriverNoPrompt, _
        Connect:=myCnc1 & myCnc2 & myCnc3 & myCnc4)
    Set myRst = myCon.OpenRecordset(myCmd)
    Worksheets.Add					'u@sW
    With myRst
        'tW
        For i = 1 To .Fields.Count
            Cells(1, i).Value = .Fields(i - 1).Name
        Next
        'O
        Range("A2").CopyFromRecordset myRst
        .Close
    End With
    myCon.Close
    myWsp.Close
    Set myRst = Nothing					'
    Set myCon = Nothing
    Set myWsp = Nothing
End Sub
